package src.main.java.org.methodReferences;

import java.util.Arrays;
import java.util.Comparator;

public class Test2 {
    public static void main(String[] args) {
        String[] name = {"boby","angela","Andy","dlei","caocao","Babo","jack","Cici"};
        //默认按照首字母编号升序排序
        Arrays.sort(name);
        System.out.println(Arrays.toString(name));

        //忽略首字母大小写排序
        /*Arrays.sort(name, new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                return o1.compareToIgnoreCase(o2);
            }
        });*/
//        Arrays.sort(name, ( o1,  o2) -> o1.compareToIgnoreCase(o2));
        //特定类型的方法引用
        Arrays.sort(name, String::compareToIgnoreCase);
    }
}
